<?php
// +----------------------------------------------------------------------
// | OneKeyAdmin [ Believe that you can do better ]
// +----------------------------------------------------------------------
// | Copyright (c) 2020-2023 http://onekeyadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: MUKE <513038996@qq.com>
// +----------------------------------------------------------------------
namespace app\index\controller;

use think\facade\Db;
use think\facade\View;
use think\captcha\facade\Captcha;
use app\index\addons\Url;
use app\index\BaseController;
/**
 * 系统页面
 */
class Page extends BaseController
{
    /**
     * 分类页面
     */
    public function index()
    {
        if (empty($this->request->catalog['id'])) {
            return abort(404);
        }
        $name = str_replace('-', '_', $this->request->catalog['seo_url']);
        $name = empty($name) ? 'page' : $name;
        return View::fetch($name);
    }
    
    // 验证码
    public function captcha() 
    {
        return Captcha::create();
    }
}